﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using LEEAAttendanceControl.AttendanceReference;
using System.ServiceModel;
using System.Windows.Browser;

namespace LEEAAttendanceControl.General
{
    public class No
    {
        public static int MinusOne = -1;
        public static int Zero = 0;
        public static int One = 1;
        public static int Two = 2;
        public static int Three = 3;
        public static int Fourth = 4;
        public static int Fifth = 5;
        public static int Seven = 6;
        public static int Eight = 7;
    }
    public class General
    {
        public static AttendanceServiceClient GetProxy()
        {
            AttendanceServiceClient proxy = new AttendanceServiceClient();
            proxy.Endpoint.Address = new EndpointAddress("http://localhost:" + HtmlPage.Document.DocumentUri.Port + "/Services/AttendanceService.svc");
            return proxy;
        }
        public static string GetUrl()
        {
            return "http://localhost:" + HtmlPage.Document.DocumentUri.Port;
        }
        public static DateTime FirstDayOfCurrentMonth()
        {
            DateTime dateTime = DateTime.Now;
            return new DateTime(dateTime.Year, dateTime.Month, 1);
        }
        public static DateTime LastDayOfCurrentMonth()
        {
            DateTime dateTime=DateTime.Now;
            DateTime firstDayOfTheMonth = new DateTime(dateTime.Year, dateTime.Month, 1);
            return firstDayOfTheMonth.AddMonths(No.One).AddDays(No.MinusOne);
        }
    }
}
